import Axios from "axios";
import { BaseService } from "./BaseService";


export class TestService extends BaseService {
    public static readonly instance = new TestService();

    public async queryWithoutParams(): Promise<any> {
        return (await Axios.get(`/api/test/query/no-params`));
    }

    public async queryWithPathParams(name: string, age: number): Promise<any> {
        return (await Axios.get(`/api/test/query/${name}/${age}`));
    }

    public async queryWithRequestBody(data: TestRequest): Promise<any> {
        return (await Axios.get(`/api/test/query/with-body`, {params: data}));
    }

    public async create(data: TestRequest): Promise<any> {
        return (await Axios.post(`/api/test/create`, data));
    }


}

export interface TestRequest {
    requestName: string;
    requestCode: string;
}